package com.saycode.common.dao;

import com.saycode.common.beans.Article;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

/**
 * @author 程序猿DD
 * @version 1.0.0
 * @date 16/4/27 下午10:16.
 * @blog http://blog.didispace.com
 */
public interface ArticleRepository extends MongoRepository<Article, Long> {

    Article findByTitle(String title);
    Article findById(Long id);
    Page<Article> findByStatus(Integer status, Pageable pageable);
    Page<Article> findByStatusAndContentType(Integer status,String contentType, Pageable pageable);
    Page<Article> findByUserId(Long userId, Pageable pageable);




}
